import {
  LOGIN,
  LOGOUT,
  SHOP_CART,
} from '../constants'

export const login = (accountInfo: any) => {
  return {
    type: LOGIN,
    accountInfo: accountInfo
  }
}

export const logout = () => {
  return {
    type: LOGOUT
  }
}

export const setShopCart = (cartData: any = {}) => {
  return {
    type: SHOP_CART,
    cartData: {
      cartList: cartData.cartList || [],
      invalidCartList: cartData.invalidCartList || []
    }
  }
}
